package cn.lentme.demo.request.viewmodel

import android.util.Log
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import cn.lentme.demo.base.BaseViewModel
import cn.lentme.demo.entity.HitokotoData
import cn.lentme.demo.request.repository.BlankRepository

class BlankViewModel(private val repository: BlankRepository): BaseViewModel() {
    private val _tag = "BlankViewModel"

    private val hitokotoData by lazy {
        MutableLiveData<HitokotoData>()
    }

    fun fetchHitokotoData(): LiveData<HitokotoData> {
        launchUI {
            val result = repository.getHitokotoData()
            Log.d(_tag, "fetchHitokotoData ------------> $result")
            hitokotoData.value = result
        }
        return hitokotoData
    }
}